<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->


<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-cn" xml:lang="zh-cn">
<head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="DC.Type" content="topic">
<meta name="DC.Title" content="挂载对象存储到数据保护代理">
<meta name="product" content="">
<meta name="DC.Relation" scheme="URI" content="zh-cn_topic_0000001839187697.html">
<meta name="prodname" content="">
<meta name="version" content="">
<meta name="brand" content="30-OceanProtect 备份一体机 1.5.0-1.6.0 帮助中心">
<meta name="DC.Publisher" content="20240320">
<meta name="DC.Format" content="XHTML">
<meta name="DC.Identifier" content="ZH-CN_TOPIC_0000001855872137">
<meta name="DC.Language" content="zh-cn">
<link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
<title>挂载对象存储到数据保护代理</title>
</head>
<body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px"><a name="ZH-CN_TOPIC_0000001855872137"></a><a name="ZH-CN_TOPIC_0000001855872137"></a>

<h1 class="topictitle1">挂载对象存储到数据保护代理</h1>
<div><p id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_p8060118">执行对象存储备份前，您需要参考本节操作，将对象存储挂载到数据保护代理主机。挂载完成的对象存储可以当做普通的文件系统，在管理界面执行备份恢复操作。</p>
<div class="section" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_section25967533276"><h4 class="sectiontitle">前提条件</h4><ul id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_ul23806131347"><li id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_li19380813113413">已安装ProtectAgent。安装操作请参见<a href="zh-cn_topic_0000001792549988.html">安装ProtectAgent软件及相关软件</a><span id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_cite930416551262">《OceanProtect <span id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_zh-cn_topic_0000001792502994_ph19170214112011">备份一体机 1.5.0-1.6.0</span> ProtectAgent安装指南》</span>中的<span class="uicontrol" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_uicontrol232725504">“安装ProtectAgent软件及相关软件”</span>章节。</li><li id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_zh-cn_topic_0000001408387233_zh-cn_topic_0000001387868089_zh-cn_topic_0000001132896521_zh-cn_topic_0000001125223205_zh-cn_topic_0000001091431193_li1131331410417">已获取对象存储的AK和SK。</li></ul>
</div>
<div class="section" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_section158567136300"><h4 class="sectiontitle">注意事项</h4><p id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_p842151933018">当前仅支持S3协议的对象存储，S3协议支持的操作系统版本请参见<a href="https://info.support.huawei.com/storage/comp/#/oceanprotect" target="_blank" rel="noopener noreferrer">兼容性查询工具</a>。</p>
</div>
<div class="section" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_section6811356112810"><h4 class="sectiontitle">操作步骤</h4><ol id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_ol514291182913"><li id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_li576244513111"><span>使用<strong id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_b572424673117">root</strong>账户登录代理主机。</span></li><li id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_li414291102913"><span>在数据保护代理主机上下载并安装S3fs。</span><p><ol type="a" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_ol976883613015"><li id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_li941002710314">依次执行以下命令，下载S3fs-fuse源码。<pre class="screen" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_screen357510385720">cd /root</pre>
<pre class="screen" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_screen1862814180326">git clone https://github.com/s3fs-fuse/s3fs-fuse.git</pre>
<p id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_p563294719339">回显如下信息时，源码下载成功。</p>
<pre class="screen" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_screen47366753419">Resolving deletas:100% (2203/2203)... done
Checking connectivity... done</pre>
</li><li id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_li136432025172117">执行以下命令，解压压缩包。<pre class="screen" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_screen171823392215">unzip s3fs-fuse-master.zip</pre>
</li><li id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_li13743175682117">依次执行以下命令安装S3fs。<pre class="screen" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_screen126411437152215">cd /root/s3fs-fuse/</pre>
<pre class="screen" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_screen18626651122219">./autogen.sh</pre>
<pre class="screen" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_screen96941659162214">./configure</pre>
<pre class="screen" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_screen946112316237">make</pre>
<pre class="screen" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_screen04303018231">makeinstall</pre>
</li><li id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_li243921142918">执行以下命令验证安装是否成功。<pre class="screen" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_screen1235141515293">s3fs</pre>
<p id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_p868462413291">回显如下信息，表示安装成功。</p>
<pre class="screen" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_screen22841355173015">s3fs: missing BUCKET argument.
Usage: s3fs BUCKET:[PATH] MOUNTPOINT [OPTION]...</pre>
</li></ol>
</p></li><li id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_li680971518313"><span>挂载S3的桶。</span><p><ol type="a" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_ol1540217317344"><li id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_li940312373418"><a name="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_li940312373418"></a><a name="zh-cn_topic_0000001801653198_li940312373418"></a>进入<span class="uicontrol" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_uicontrol183051041134115">“/home”</span>目录，依次执行以下命令，新建<span class="uicontrol" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_uicontrol17878175053418">“passwd-s3fs”</span>文件，用于存放AK和SK。文件的格式必须为<span class="uicontrol" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_uicontrol128961633123716">“AK:SK”</span>。<pre class="screen" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_screen6761122824115">mkdir s3</pre>
<pre class="screen" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_screen1654514577417">cd /home/s3</pre>
<pre class="screen" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_screen04961947133417">touch passwd-s3fs</pre>
<pre class="screen" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_screen6253197173610">vi passwd-s3fs</pre>
<p id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_p13620114615348"><span class="uicontrol" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_uicontrol92745519348">“passwd-s3fs”</span>文件内容示例如下：</p>
<pre class="screen" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_screen17119216358">D3F00C9CE4FC2FC5FFD1:vssChPXeU8hiZ7OTo2vvcSpbigEAAAF85Pwvxa7b</pre>
</li><li id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_li817112717365">执行以下命令修改<span class="uicontrol" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_uicontrol18313853203718">“passwd-s3fs”</span>文件权限。<pre class="screen" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_screen511381503616">chmod 600 passwd-s3fs</pre>
</li><li id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_li152853429388">执行以下命令挂载S3的桶到本地。其中，<span class="uicontrol" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_uicontrol41401126194613">“S3桶名”</span>为要挂载到本地的S3的桶名称，<span class="uicontrol" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_uicontrol7684113574612">“本地挂载路径”</span>为要挂载桶的本地路径，<span class="uicontrol" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_uicontrol522404054718">“AKSK密钥文件路径为”</span><a href="#ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_li940312373418">1</a>中的新建<span class="uicontrol" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_uicontrol188552624717">“passwd-s3fs”</span>文件绝对路径。<pre class="screen" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_screen1457613128391">s3fs <em id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_i7992192010459">S3桶名</em> <em id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_i1583012234451">本地挂载路径</em> -o passwd_file=<em id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_i060642710459">AKSK密钥文件路径</em> -o url=<em id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_i10361432194515">S3的endpoint</em> -o uid=1002,gid=1002 -o use_path_request_style</pre>
<p id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_p1590519268480">示例如下：</p>
<pre class="screen" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_screen1542183512482">s3fs test-2t /home/s3mount -o passwd_file=/home/s3/passwd-s3fs -o url=http://192.168.99.182 -o uid=1002,gid=1002 -o use_path_request_style</pre>
</li><li id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_li159661940155017">执行<strong id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_b326120112516">mount</strong>命令，如果回显如下信息，说明挂载成功。<pre class="screen" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_screen15916135415502">s3fs on /home/s3mount type fuse.s3fs (rw,nosuid,nodev,relatime,use_id=0,group_id=0)</pre>
<div class="note" id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_note93183121469"><img src="public_sys-resources/note_3.0-zh-cn.png"><span class="notetitle"> </span><div class="notebody"><ul id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_ul12862137185212"><li id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_li208486813528">如果数据保护代理重启，已挂载的对象存储会取消挂载，执行后续操作前请确认对象存储的挂载状态。</li><li id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_li1686212714526">挂载完成，并对对象存储执行备份恢复操作后，可以执行<strong id="ZH-CN_TOPIC_0000001855872137__zh-cn_topic_0000001801653198_b9897161717539">umount</strong>命令取消挂载。</li></ul>
</div></div>
</li></ol>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>父主题：</strong> <a href="zh-cn_topic_0000001839187697.html">备份</a></div>
</div>
</div>

<div class="hrcopyright"><hr size="2"></div><div class="hwcopyright">版权所有 &copy; 华为技术有限公司</div></body>
</html>